Getting a Handle on Web Services in Macromedia Flash MX Professional 2004
Vera Fleischer
Table of Contents
- Introduction
- Types of Web Services That Work with Flash MX Professional 2004
- Limitations of Handling Web Services in Flash MX Professional 2004
- Differences Between the WebServiceConnector, WebService API, and Flash Remoting
- Web Service Proxies as an Alternative to Flash Remoting
- Building a Generic Web Service Proxy in PHP
So you have heard that Macromedia Flash MX Professional 2004 has built-in support for web services. Great! But is this unconditionally true? Are all web services now supported in Flash? Are there exceptions? Workarounds? What if the server on which the web service is hosted doesn't have a policy file?
I have answers for you. For two whole weeks I did nothing but scour the web for different kinds of web services to see how Flash would handle them. In this article I will discuss most of my findings. In light of the fact that there are all kinds of different web services out there, I will also do a quick comparison of the advantages of the WebServiceConnector component, the WebService classes, and Macromedia Flash Remoting. For a more detailed comparison, please refer to Choosing Between XML, Web Services, and Remoting for Rich Internet Applications by Steven Webster. Finally, I am going to walk you through the creation of a generic web service proxy in PHP to solve the cross-domain problem. This proxy will let you hook up to any SOAP web service, with or without a policy file. Let's do it!
Requirements
To complete this tutorial you will need to install the following software and files:
Macromedia Flash MX Professional 2004
For the web server proxy example:
- A web server configured with PHP
- Nusoap
- Serializer class
Tutorials and sample files:
quiz_genericproxy.zip (191K)
To get the most out of this tutorial, you should be familiar with the WebServiceConnector component and the WebService API in Flash MX Professional 2004. If you aren't familiar with them, please browse through the web services resource links on the Macromedia Developer Center, making sure to check out Jeffrey Hill's article, Using the Flash MX 2004 Web Service Classes, on flash-db.com. To complete the proxy server example, you should also have some experience with a server-side scripting language such as PHP or ColdFusion.